package html.states.home.notifications;
import data.Message;
import data.Task;
import html.util.Container;
import js.Dom;
import oboe.core.SigSlot;

/**
 * ...
 * @author Felipe Manga
 */

class NotificationManager extends Container
{
	public function new() 
	{
		super( "notifications" );
		
		this.addChild( new Notification( "tasks" ) );
		this.addChild( new Notification( "messages" ) );
	}
	
	@slot function notifyNewTask( tasks:Array<Task> ):Void
	{
		for ( t in tasks ) this.signalDown("newMessage", ["tasks", t]);
	}
	
	@slot function notifyNewMessage( msgs:Array<Message> ):Void
	{
		for ( m in msgs ) this.signalDown( "newMessage", ["messages", m] );
	}
}